<div class="child" {% if cf.instance.id %}id="child{{ cf.instance.id }}"{% endif %}>
{% load filters %}
    <fieldset class="block form">
    {% if not cf.instance.id %}
        <legend>Nouveau Ticket fils</legend>
        <span>
    {% else %}
    <legend><img src="{{ MEDIA_URL }}images/{% if cf.instance.state_id == 4 %}plus.png{% else %}minus.png{% endif %}" alt="plus" onClick="togglePlusMinus(this, 'child{{ cf.instance.id }}_content');" />
        {% if cf.instance.state.img %}<img src="{{ cf.instance.state.img.url }}" alt="{{ cf.instance.state }}" />{% else %}[ {{ cf.instance.state }} ]{% endif %}
        &nbsp;{{ cf.instance.title }}
    </legend>
        <span id="child{{ cf.instance.id }}_content" style="display: {% if cf.instance.state_id == settings.TICKET_STATE_CLOSED %}none{% else %}inline{% endif %}">
    {% endif %}
            {{ cf.id }}
            <span>{{ cf.category.label_tag }} {{ cf.category }}</span>
            <span>{{ cf.project.label_tag }} {{ cf.project }}</span>
            <span>{{ cf.state.label_tag }} {{ cf.state }}</span>
            <span>{{ cf.assigned_to.label_tag }} {{ cf.assigned_to }}</span>
            <span>{{ cf.diffusion }}</span>
            <span id="{{ cf.get_exact_id|interpret:"tooltip-diffusion" }}" class="mail_image"><img onClick="toggleMailImage(this);" src="{{ MEDIA_URL }}images/oxygen/{% if cf.instance.id and cf.instance.diffusion %}diffusion{% else %}nodiffusion{% endif %}.png" alt="diffusion" /></span>
            <div dojoType="dijit.Tooltip" connectId="{{ cf.get_exact_id|interpret:"tooltip-diffusion" }}" position"above">
                <h3>Diffusion du ticket fils</h3>
                <p>Si activé, le ticket fils sera présent dans les mails envoyés par Claritick et visible par le client</p>
            </div>
            {% if cf.instance.id %}
            <span id="delete_child{{ cf.instance.id }}" style="display: none">{{ cf.DELETE.label_tag }} {{ cf.DELETE }}</span>
            {% endif %}
            <hr />
            <table>
                <tr>
                    <th class="large">{{ cf.title.label_tag }}</th>
                    <td {% if cf.instance.id %}ticket_id="{{ cf.instance.id }}"{% endif %} class="large right">{{ cf.title }}</td>
                    <td class="large right">{{ cf.title.errors }}</td>
                </tr>
                <tr>
                    <th></th>
                    <td {% if cf.instance.id %}ticket_id="{{ cf.instance.id }}"{% endif %} class="right">{{ cf.text }}</td>
                    <td class="right">{{ cf.text.errors }}</td>
                </tr>
                <tr>
                    <th class="large">{{ cf.keywords.label_tag }}</th>
                    <td class="right">{{ cf.keywords }}</td>
                    <td></td>
                </tr>
            </table>
            <hr />
            {% with cf as form_to_comment %}
            {% include "ticket/comment.html" %}
            {% endwith %}
        </span>
    </fieldset>
</div>
